package org.example.interncandidate.controller.login;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.interncandidate.common.model.BaseResponse;
import org.example.interncandidate.model.person.dto.LoginRequestDTO;
import org.example.interncandidate.model.person.vo.PersonInfoVO;
import org.example.interncandidate.service.login.LoginService;
import org.example.interncandidate.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "登录")
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;
    @ApiOperation("普通用户登录")
    @PostMapping("/user")
    public BaseResponse<PersonInfoVO> login(@RequestBody LoginRequestDTO loginRequest){
        return ResultUtil.success(loginService.login(loginRequest));
    }
}
